package org.netEase.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.netEase.dao.commentDao;
import org.netEase.dao.impl.commentDaoImple;
import org.netEase.entity.comment;

import com.alibaba.fastjson.JSON;

@WebServlet(urlPatterns = { "/backstageManager/commentsAdmin.shtml" })
public class commentAdmin extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String id=request.getParameter("comsid");
		commentDao commentDao = new commentDaoImple();
		comment com=commentDao.getIds(Integer.parseInt(id));
		response.setContentType("application/json;charset=utf-8");
		String commentInfo=JSON.toJSONString(com);
		response.getWriter().write(commentInfo);
	}
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doPost(request, response);
	}

}
